package com.example.bookmanage.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ResultCode {

    //操作成功
    SUCCESS(1000, "操作成功"),

    //服务器内部错误，友好提⽰
    ERROR(2000, "服务繁忙请稍后重试"),

    //操作失败，但是服务器不存在异常
    FAILED(3000, "操作失败"),
    FAILED_UNAUTHORIZED(3001, "未授权"),
    FAILED_PARAMS_VALIDATE(3002, "参数校验失败"),
    FAILED_NOT_EXISTS(3003, "资源不存在"),
    FAILED_ALREADY_EXISTS(3004, "资源已存在"),
    INVALID_PARAMETER(3005, "参数不合法"),

    USER_NOT_EXIST(3101, "用户不存在"),
    ACCOUNT_PASSWORD_ERROR(3102, "账号或密码错误"),
    USER_EXIST(3103, "用户已存在");

    private final int code;
    private final String msg;

}
